package com.sunchangming.uniqname;

import org.apache.mina.transport.socket.nio.NioSocketAcceptor;

public class Server implements ServerMXBean {
	private final NioSocketAcceptor acceptor;
	public Server(NioSocketAcceptor acceptor) {
		this.acceptor=acceptor;
		
	}

	public ServerIoHandler getHandler(){
		return (ServerIoHandler)acceptor.getHandler();
	}
	
	public int  getConnectCount(){
		return getHandler().getConnectCount();
	}
	
	@Override
	public void stop() {
		ServerMain.stop();		
	}

}
